﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.ServiceModel.Activation;
using System.ServiceModel.Web;
using System.Text;
using D3DSS.IDomain;
using D3DSS.DataContract;

namespace D3DSS.Service
{
    /// <summary>
    /// 更新服务
    /// </summary>
    [ServiceContract]
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)]
    public class UpdateService
    {
        protected IUpdate Update { get; set; }

        public UpdateService(IUpdate update)
        {
            Update = update;
        }

        /// <summary>
        /// 判断是否有版本更新
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [WebInvoke(UriTemplate = "", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        public Response<UpdateResponse> IsUpdate(UpdateRequest request)
        {
            return Update.IsUpdate(request);
        }
    }
}
